package scoutobahn.xml.automaton;

import org.xml.sax.Attributes;

/**
 * The undefined state of the parser.
 * @author mark
 *
 */
public class UndefinedState extends ParserState {
/**
 * Constructs a new UndefinedState with the given StateManager.
 * @param stateManager The StateManager
 */
    public UndefinedState(
            final StateManager stateManager) {
        super(stateManager);
    }

    @Override
    public ParserState startElement(final String nameSpace,
            final String localName,
            final String qName,
            final Attributes attr) {
        if (localName.equals("node")) {
            return super.getStateManager()
                    .getNodeState()
                    .startElement(nameSpace, localName, qName, attr);
        }
        if (localName.equals("relation")) {
            return super.getStateManager()
                    .getRelationState()
                    .startElement(nameSpace, localName, qName, attr);
        }
        if (localName.equals("way")) {
            return super.getStateManager()
                    .getWayState()
                    .startElement(nameSpace, localName, qName, attr);
        }
        return this;
    }

    @Override
    public ParserState endElement(final String uri,
            final String localName,
            final String qName) {
        return this;
    }

}
